package main
import(
	"fmt"
	"encoding/json"
)
type User struct{
	UserName string `json:"username"`
	Sex string `json:"sex"`
	Score float32
}

func main()  {
	user := &User{
		UserName:"user01",
		Sex:"男",
		Score:99.2,
	}
	data,_:=json.Marshal(user)
	fmt.Printf("json str:%s\n",string(data))
}